<?php  namespace Home\Model;
use Hdphp\Model\Model;
class OrderList extends Model{
    protected $table = "order_list";
        //添加订单列表
    public function store($oid){
        $data = array();
        $glModel = new \Admin\Model\Goods_list;
        //重组数组，压入数据库
        foreach ($_SESSION['cart']['goods'] as $k => $v) {
            $data['quantity']  = $v['num'];
            $data['subtotal']  = $v['total'];
            $data['glid']      = $v['glid'];
            $data['goods_gid'] = $v['id'];
            $data['art_no']    = $glModel->where("goods_gid={$v['id']}")->pluck('art_no');
            $data['order_oid'] = $oid;
            $this->add($data);
        }
        return true;
    }
















    
}





?>